package gui2.g2;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class Paitning extends JPanel {
	
	{
		setPreferredSize(new Dimension(700,700));
	}
	
	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		
		Graphics2D g2 = (Graphics2D)g;
		
		g.setColor(Color.RED);
		g.drawRect(10, 10, 200, 100);
		g.setColor(new Color(0,0,255,100));
		g.fillOval(30, 30, 160, 160);
	}
	

	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {

			@Override
			public void run() {
				JFrame f = new JFrame();
				f.getContentPane().add(new Paitning());
				f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
				f.pack();
				f.setVisible(true);
			}
		});
	}
}
